GXIntersectShape
You can use theGXIntersectShape
function to find the intersection of two shapes.
void GXIntersectShape(gxShape target, gxShape operand);
target
- On input, a reference to one of the shapes to intersect. On output, a reference to the intersection of the input target shape and the operand shape.
operand
- A reference to the other shape to intersect.
DESCRIPTION
TheGXIntersectShape
function finds the intersection of the target shape and the operand shape, reduces and simplifies the result, and stores it in the target shape. If the original target shape and the operand shape do not intersect, the resulting target shape is an empty shape.If the target shape and the operand shape share only an edge, and if both have a solid fill, the resulting target shape is an empty shape. However, you can provide a framed target shape and a solid operand shape--the result being a framed shape.
This function considers the shape fill, the style modifications, and the transform mapping of the target and operand shapes. Only areas that are drawn are considered when determining intersection.
If you provide a target or operand shape that is not one of the geometric shape types, this function performs the actions described in the following table:
- Implementation Note
- Due to an implementation limit with QuickDraw GX version 1.0, you can find the intersection of two framed shapes only if the shapes are points, lines, or curves.
![]()
Shape type Action taken bitmap Posts the error shape_operator_may_not_be_a_bitmap
picture Posts the error shape_operator_may_not_be_a_picture
text Converts to path shape if other parameter is not an empty shape or a full shape glyph Converts to path shape if other parameter is not an empty shape or a full shape layout Converts to path shape if other parameter is not an empty shape or a full shape ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil number_of_contours_exceeds_implementation_limit number_of_points_exceeds_implementation_limit size_of_path_exceeds_implementation_limit size_of_polygon_exceeds_implementation_limit fill_type_not_allowed (debugging version) shape_access_not_allowed (debugging version) clip_to_frame_shape_unimplemented (debugging version) shape_operator_may_not_be_a_bitmap (debugging version) shape_operator_may_not_be_a_picture (debugging version) Warnings character_substitution_took_place font_substitution_took_place unable_to_traverse_open_contour_that_starts_or_ends_off_the_curve (debugging version) SEE ALSO
For an example using this function, see "Performing Geometric Arithmetic With Shapes" beginning on page 4-60.For a discussion of geometric arithmetic, see "Geometric Arithmetic" beginning on page 4-21.
For a discussion of shape fills, see Chapter 2, "Geometric Shapes," in this book.
For a discussion of style modifications, see Chapter 3, "Geometric Styles," in this book.
For a discussion of transform mappings, see the chapter "Transform Objects" in Inside Macintosh: QuickDraw GX Objects.
To determine if two shapes touch, use the
GXTouchesShape
function, described on page 4-98.To find the union of two shapes, use the
GXUnionShape
function, described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help